﻿using System;

namespace ContainerVariations.Common
{
    public interface IHouse
    {
        void OpenDoor();
    }

    public class House : IHouse
    {
        private readonly IDoor _door;

        public House(IDoor door)
        {
            _door = door;
        }

        public void OpenDoor()
        {
            Console.WriteLine("House: Opening door.");
            if (_door.Open())
            {
                Console.WriteLine("House: Door opened.");
            }
            else
            {
                Console.WriteLine("House: Door not opened.");
            }
        }
    }
}